Fix paddle.vision.ops.deform_conv2d API big Tensor#74058
Merged
wanghuancoder merged 9 commits intoPaddlePaddle:developfrom Jul 24, 2025
Merged
Fix paddle.vision.ops.deform_conv2d API big Tensor#74058wanghuancoder merged 9 commits intoPaddlePaddle:developfrom
wanghuancoder merged 9 commits intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (26.15%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #74058 +/- ##
==========================================
Coverage ? 26.15%
==========================================
Files ? 3
Lines ? 65
Branches ? 0
==========================================
Hits ? 17
Misses ? 48
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
lshpku
previously approved these changes
Jul 23, 2025
lshpku
approved these changes
Jul 24, 2025
xingmingyyj
added a commit
to xingmingyyj/Paddle
that referenced
this pull request
Jul 30, 2025
…dle#74058)" This reverts commit 3067726.
xuxinyi389
pushed a commit
that referenced
this pull request
Jul 30, 2025
xingmingyyj
added a commit
to xingmingyyj/Paddle
that referenced
this pull request
Aug 5, 2025
…dle#74058)" This reverts commit 3067726.
xingmingyyj
added a commit
to xingmingyyj/Paddle
that referenced
this pull request
Aug 6, 2025
…dle#74058)" This reverts commit 3067726.
phlrain
pushed a commit
that referenced
this pull request
Aug 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Operator Mechanism
PR Types
Bug fixes
Description
offset的反向传播公式为:
$$\frac{\partial L}{\partial \Delta p_n} = \sum_{p_0} \frac{\partial L}{\partial y(p_0)} \cdot w(p_n) \cdot \frac{\partial x (p_0 + p_n + \Delta p_n)}{\partial \Delta p_n}$$
其中:
paddle和torch在计算双线性插值反向时有diff。当点$p_0 + p_n + \Delta p_n$越界时,例如,$p_0 + p_n + \Delta p_n=(-1,0)$, paddle前向直接返回0,反向直接返回0。torch前向直接返回0,但是会给周围没有越界的点回传梯度。对齐torch实现后,精度可以对齐。这里保持了paddle的实现。paddle代码实现位置:https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/phi/kernels/impl/deformable_conv_grad_kernel_impl.h#L62
;torch代码实现位置:https://github.com/pytorch/vision/blob/main/torchvision/csrc/ops/cuda/deform_conv2d_kernel.cu#L494。
怀疑是Matmul导致,Matmul修复后进行验证。
Pcard-73263